package com.zhentao.controller;

import com.zhentao.model.dtos.ResponseResult;
import com.zhentao.model.wemedia.dto.WmMaterialDto;
import com.zhentao.service.WmMaterialService;
import com.zhentao.service.WmUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/api/v1/material")
public class WmMaterialController {
    @Autowired
    private WmMaterialService wmMaterialService;

    /**
     * 自媒体端素材上传
     * @param multipartFile  图片
     * @return ResponseResult
     */
    @PostMapping("/upload_picture")
    public ResponseResult upload_picture(MultipartFile multipartFile){
        //System.err.println(multipartFile);
        return wmMaterialService.uploadPicture(multipartFile);
    }

    /**
     * 分页查询 素材列表
     * @param wmMaterialDto
     * @return
     */
    @PostMapping("/list")
    public ResponseResult list(@RequestBody WmMaterialDto wmMaterialDto){
        return wmMaterialService.list(wmMaterialDto);
    }

}



















